/**  存放所有评论相关接口 */
import myaxios from "../MyAxios";
import URLENV from "@/http/BaseUrl";
const BMDURL = URLENV.BMDURL;

const PostbarApi = {
  /** 查询所有评论 返回发送请求后的Promise对象*/
  queryAllPostbars(params) {
    let url = BMDURL + "/postbar/userid";
    return myaxios.get(url, params);
  },

  /**
   * 新增评论
   * @param {object} params
   * 参数列表：{actor_name:姓名,actor_avatar:头像路径}
   */
  add(params) {
    let url = BMDURL + "/postbar/add";
    return myaxios.post(url, params);
  },
  /**
   * 通过用户id，查询对相应的评论
   * @param {object} params 参数列表：{name:'关键字'}
   */
  queryPostbarsByUser(params) {
    let url = BMDURL + "/postbar/userId";
    return myaxios.post(url, params);
  },

  /**
   * 通过姓名关键字，模糊查询演员列表
   * @param {object} params 参数列表：{name:'关键字'}
   */
  queryPostbarsByNameLike(params) {
    let url = BMDURL + "/movie-actors/name";
    return myaxios.post(url, params);
  },

  /**
   * 删除评论
   * @param {object} params
   * 参数列表：{id：演员ID}
   */
  delete(params) {
    let url = BMDURL + "/movie-actor/del";
    return myaxios.post(url, params);
  },
};

export default PostbarApi;
